home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Part Server
- Sent: 7/10/96 4:23 PM
- Received: 7/10/96 3:31 PM
- From: Greg Friedman, friedman@cognosis.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- Serge Froment wrote:
- > Thanks for your helpful information. I have more questions, though.
- >
- > >- Create a shared library that has a callable C or SOM API
- > >- Make the shared libraries data fragment shared. Use globals to point at
- > >data structures that all parts and processes should share.
- > >- Clients call the C or SOM API
- > >- Optionally use the threads manager from within the shared library
- >
- > With such a shared library, in which process will the data fragment live?
- > In which heap will a call to NewHandle allocate memory? Can I use temp
- > memory? If I crash inside the shared library, will the memory it allocated
- > be released?
-
- Shared data fragments are loaded into the system heap. It's a good idea,
- when discussing these issues, to differentiate between "heaps" and
- "processes".
-
- You can use temp memory.
-
- NewHandle will allocate memory in the current heap zone. This will be the
- zone of the client process, since calling into a shared library doesn't
- result in a call to SetZone.
-
- I suspect that memory allocated by the shared library will be deallocated
- when the calling process quits. This is certainly true of memory allocated
- in the application zone. I believe that starting with some version of
- System 7.x, temp memory allocated by an application began getting
- automatically deallocated when the process was terminated. In my opinion,
- it's a good idea to explicitly deallocate memory.
-
- I suggest you try not to crash in the shared library. Your users won't like
- it if you do, and will have concerns other than whether or not temp memory
- was deallocated.
-
- > If I use the thread manager, where will threads live, relative to
- > processes? This may be a dumb question, but I thought threads must belong
- > to a process.
-
- The thread should belong to the process that called the shared library.
- This is an educated guess - you'll have to play with this architecture to
- confirm that it works.
-
- > >MacApp has been used to create background tasks, but there is no intrinsic
- > >support in the framework. I don't know about PowerPlant. I'm not sure you'd
- > >need an framework, anyhow. You probably don't want to create a fullblown
- > >app. You certainly don't need all of the menu, view, document stuff that
- > >the frameworks provide. You could probably roll your own with only a
- > >minimum of application code.
- >
- > I obviously don't need menus, but I think MacApp has some nice stuff to
- > handle AppleEvents. Can I use that without using the remaining of MacApp?
-
- MacApp has excellent support for Apple Events. I know the guy that did the
- MacApp OSA support. I like him. So does my fiance. As a matter of fact,
- she's marrying him next weekend.
-
- You're going to have a tough time breaking apple event support out of
- MacApp. It's dependent on the MacApp TObject hierarchy, as well as the
- MacApp string, stream, and color classes.
-
- Greg.
-
-
- ___________________________________________________________
- Greg Friedman ODF Engineering Apple Computer
-
-
-